home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Apple II Sample Code / MPW IIGS SC / SC.022.AutoLaunch / autolaunch.h next >
Encoding:
C/C++ Source or Header  |  1990-06-24  |  5.3 KB  |  204 lines  |  [TEXT/MPS ]

  1. /***********************************************************************
  2. *
  3. * autolaunch header file. -- Version 3.0
  4. *
  5. * Copyright (c)
  6. * Apple Computer, Inc.  1990
  7. * All Rights Reserved.
  8. *
  9. * Developer Technical Support Apple II Sample Code
  10. *
  11. ***********************************************************************/
  12.  
  13. #define productionVersion 1
  14.  
  15. #define __fmdLib__
  16. #include <fakeModalDialog.h>
  17.  
  18. #if productionVersion
  19. #define initPtrCheck(x);
  20. #define closePtrCheck();
  21. #define zapLocals();
  22. #define checkForHit();
  23. #endif
  24.  
  25. extern pascal void    handleKeys();
  26.  
  27. /**********************************************************************/
  28.  
  29. /* The ifdef below allows the definitions to be external, except
  30. ** for the globals file.  This way, everybody can use autolaunch.h.
  31. */
  32.  
  33. #ifdef __globals__
  34. #define cextern
  35. #else
  36. #define cextern extern
  37. #endif
  38.  
  39. #ifndef __QUICKDRAW__
  40. #include <quickdraw.h>
  41. #endif
  42.  
  43. #ifndef __PRINT__
  44. #include <print.h>
  45. #endif
  46.  
  47. #ifndef __GSOS__
  48. #include <gsos.h>
  49. #endif
  50.  
  51. /********************************************************/
  52.  
  53. #define MainWindowID    0x1000L
  54. #define AppLaunch        1L
  55. #define AppTriggerText    10L
  56. #define AppTriggerData    11L
  57. #define AppTargetText    12L
  58. #define AppTargetData    13L
  59. #define AppTimerText    14L
  60. #define AppTimerData    15L
  61. #define AppUnitText        16L
  62.  
  63. #define AboutWindowID    0x2000L
  64.  
  65. /*******************************************/
  66.  
  67. #define SHORTINDEX        123
  68.  
  69. #define AppleMenuID        0x901
  70. #define AboutItem            301
  71.  
  72. #define FileMenuID        0x902
  73. #define CloseItem            255        /* For DA's */
  74. #define ChooseTriggerItem    401
  75. #define ChooseTargetItem    402
  76. #define SaveLaunchItem        403
  77. #define QuitItem            499
  78.  
  79. #define EditMenuID        0x903
  80. #define UndoItem            250        /* For DA's */
  81. #define CutItem                251        /* For DA's */
  82. #define CopyItem            252        /* For DA's */
  83. #define PasteItem            253        /* For DA's */
  84. #define ClearItem            254        /* For DA's */
  85.  
  86. /***********************************************/
  87.  
  88. extern char        test[80];
  89.  
  90. #ifndef __file__
  91. extern
  92. #endif
  93. unsigned int    _fileErr;
  94.  
  95. cextern unsigned int    quitFlag;            /* True when quitting */
  96. cextern WmTaskRec        event;                /* All events are returned here */
  97. cextern WindowPtr        mainWindow, aboutWindow;
  98.  
  99.  
  100. /*********** The following structures and buffers are for file IO.  ***********/
  101.  
  102. typedef struct FileIO {
  103.     OpenRecGS            open;        /* Used to open the file.                        */
  104.     RefNumRecGS            close;        /* Used to close the file.                        */
  105.     IORecGS                readWrite;    /* Use for reading and writing the file.        */
  106.     PositionRecGS        getPos;        /* Use for getting EOF and mark.                */
  107.     SetPositionRecGS    setPos;        /* Use for setting EOF and mark.                */
  108.     FileInfoRecGS        info;        /* Use for getting and setting file info.        */
  109.     CreateRecGS            create;        /* Use for creating a new file.                    */
  110. } FileIO;
  111.  
  112. typedef struct Launch {
  113.     char            triggerPath[514];    /* Standard file info for what files. */
  114.     char            triggerName[34];
  115.     char            targetPath[514];
  116.     char            targetName[34];
  117.     unsigned int    timer;                /* How many seconds between network checks. */
  118.     unsigned long    dates[4];            /* 8 bytes for old date, 8 for new. */
  119. } Launch;
  120.  
  121.  
  122.  
  123. cextern Launch launch;
  124. cextern FileIO file
  125. #ifdef __globals__
  126. = {
  127.  
  128.     {
  129.         3,                            /* pCount                We just need 3.            */
  130.         0,                            /* refNum                To be filled in.        */
  131.         NULL,                        /* pathname                To be filled in.        */
  132.         0,                            /* requestAccess        Read-only file.            */
  133.         0,                             /* resourceNumber        Unused                    */
  134.         0,                            /* access                Unused                    */
  135.         0,                            /* fileType                Unused                    */
  136.         0L,                            /* auxType                Unused                    */
  137.         0,                            /* storageType            Unused                    */
  138.         {0,0,0,0,0,0,0,0},            /* createDateTime        Unused                    */
  139.         {0,0,0,0,0,0,0,0},            /* modDateTime            Unused                    */
  140.         NULL,                        /* optionList            Unused                    */
  141.         0L,                            /* eof                    Unused                    */
  142.         0L,                            /* blocksUsed            Unused                    */
  143.         0L,                            /* resourceEOF            Unused                    */
  144.         0L                            /* resourceBlocks        Unused                    */
  145.     },
  146.  
  147.     {
  148.         1,                            /* pCount                Close just needs 1.        */
  149.         0                            /* refNum                To be filled in.        */
  150.     },
  151.  
  152.     {
  153.         4,                            /* pCount                                        */
  154.         0,                            /* refNum                To be filled in.        */
  155.         (Pointer)&launch,            /* dataBuffer            Where to put the data.    */
  156.         sizeof(launch)-16,            /* requestCount            Max # of bytes to read.    */
  157.         0L,                         /* transferCount        # of bytes read.        */
  158.         0,                            /* cachePriority        Unused                    */
  159.     },
  160.  
  161.     {
  162.         2,                            /* pCount                                        */
  163.         0,                            /* refNum                To be filled in.        */
  164.         0L,                            /* position                For GetEOF & GetMark.    */
  165.     },
  166.  
  167.     {
  168.         3,                            /* pCount                                        */
  169.         0,                            /* refNum                To be filled in.        */
  170.         0,                            /* base                    Which disp. for pos.    */
  171.         0L,                            /* displacement            For SetEOF & SetMark.    */
  172.     },
  173.  
  174.     {
  175.         7,                            /* pCount                                        */
  176.         NULL,                        /* pathname                To be filled in.        */
  177.         3,                            /* access                Read & write access        */
  178.         0,                            /* fileType                For file filetype        */
  179.         0L,                            /* auxType                For file auxtype        */
  180.         0,                            /* storageType            For file storage type    */
  181.         {0,0,0,0,0,0,0,0},            /* createDateTime        For create date            */
  182.         {0,0,0,0,0,0,0,0},            /* modDateTime            For last mod date        */
  183.         NULL,                        /* optionList            Unused                    */
  184.         0L,                            /*                         Unused                    */
  185.         0L,                            /*                         Unused                    */
  186.         0L,                            /*                         Unused                    */
  187.         0L,                            /*                         Unused                    */
  188.     },
  189.  
  190.     {
  191.         5,                            /* pCount                                        */
  192.         NULL,                        /* pathname                To be filled in.        */
  193.         0xC3,                        /* access                Unused                    */
  194.         0x5A,                        /* fileType                Unused                    */
  195.         0x0003,                        /* auxType                Unused                    */
  196.         1,                            /* storageType            Unused                    */
  197.         0L,                            /* eof                    Unused                    */
  198.         0L                            /* resourceEOF            Unused                    */
  199.     }
  200. }
  201. #endif
  202. ;
  203.  
  204.